//
//  logonView.m
//  豆瓣2
//
//  Created by dllo on 15/12/19.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import "logonView.h"

@implementation logonView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
-(instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    if (self) {
        
        [self reateSbuViewLogon];
    }
    return self;
}

- (void)reateSbuViewLogon{
    
    UILabel *alab = [[UILabel  alloc]initWithFrame:CGRectMake(50, 80, 200, 30)];
    alab.text = @"用户名";
    [self addSubview:alab];
    
    self.userfield = [[UITextField alloc]initWithFrame:CGRectMake(120, 80, 200, 30)];
    self.userfield.borderStyle = UITextBorderStyleRoundedRect;
    self.userfield.placeholder = @"请输入用户名";
    [self addSubview:self.userfield];
   
    
    
    UILabel *blab = [[UILabel alloc]initWithFrame:CGRectMake(50, 120, 200, 30)];
    blab.text = @"密码";
    [self addSubview:blab];
    
    self.surefield = [[UITextField alloc]initWithFrame:CGRectMake(120, 120, 200, 30)];
    self.surefield.placeholder = @"请输入密码";
    self.surefield.secureTextEntry =YES;
    self.surefield.borderStyle = UITextBorderStyleRoundedRect;
    [self addSubview:self.surefield];
   
    
    UILabel *clab = [[UILabel alloc]initWithFrame:CGRectMake(50, 160, 200, 30)];
    clab.text = @"确认密码";
    [self addSubview:clab];
    
    self.codefield = [[UITextField alloc]initWithFrame:CGRectMake(120, 160, 200, 30)];
    self.codefield.placeholder = @"再次确认密码";
    self.codefield.secureTextEntry = YES;
    self.codefield.borderStyle = UITextBorderStyleRoundedRect;
    [self addSubview:self.codefield];
    
    UILabel *dlab = [[UILabel alloc]initWithFrame:CGRectMake(50, 200, 200, 30)];
    dlab.text = @"邮箱";
    [self addSubview:dlab];
    
    self.emailfield = [[UITextField alloc]initWithFrame:CGRectMake(120, 200, 200, 30)];
    self.emailfield.placeholder = @"请输入邮箱";
    self.emailfield.borderStyle = UITextBorderStyleRoundedRect;
    [self addSubview:self.emailfield];
   
    
    
    UILabel *elab = [[UILabel alloc]initWithFrame:CGRectMake(50, 240, 200, 30)];
    elab.text = @"联系方式";
    [self addSubview:elab];
    
    self.contactfield = [[UITextField alloc]initWithFrame:CGRectMake(120, 240, 200, 30)];
    self.contactfield.placeholder = @"请输入联系人";
    self.contactfield.borderStyle = UITextBorderStyleRoundedRect;
    [self addSubview:self.contactfield];
  
    }

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    
    [self.userfield resignFirstResponder];
    [self.surefield resignFirstResponder];
    [self.contactfield resignFirstResponder];
    [self.codefield resignFirstResponder];
    [self.emailfield resignFirstResponder];
    
}

@end
